//
// Created by 张闳 on 2021/12/3.
//

#ifndef LIBMCOMMON_MD5_H
#define LIBMCOMMON_MD5_H
#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

#define UPPER 0
#define LOWER 1

/**
 * @input: result -- store the calculation result char[33]
 *         size   -- size of result. Make sure it's at least 33
 *                   since the result is a 32-byte hexdecimal string.
 *         message-- string to be encrypted
 *         flag   -- 0 means upper case output, 1 means lower case output
 * @return: 0 -- success
 *          1 -- result size less than 33
 *          2 -- calloc failed
 */
//int32_t cal_md5(char *result, const char *message, uint32_t flag);

char * md5_upper(const char *message);
char * md5_lower(const char *message);
#ifdef __cplusplus
}
#endif

#endif //LIBMCOMMON_MD5_H
